package studentmanagement;

public class TestSystem {
    public static void main(String[] args) {
        // 1. 创建教师
        Teacher t1 = new Teacher("T001", "王老师", "男");
        Teacher t2 = new Teacher("T002", "刘老师", "女");

        // 2. 创建课程
        Course c1 = new Course("C001", "Java编程基础", "计算机教室101", "周一 9:00-11:00");
        Course c2 = new Course("C002", "大学物理", "多媒体教室202", "周三 14:00-16:00");

        // 3. 绑定教师与课程
        t1.teach(c1);
        c1.setTeacher(t1);  // 课程关联教师
        t2.teach(c2);
        c2.setTeacher(t2);

        // 4. 创建学生
        Student s1 = new Student("S001", "张三", "男");
        Student s2 = new Student("S002", "李四", "女");

        // 5. 学生选课
        s1.selectCourse(c1);  // 张三选Java
        s1.selectCourse(c2);  // 张三选大学物理
        s1.selectCourse(c1);  // 测试重复选课
        s2.selectCourse(c1);  // 李四选Java

        // 6. 学生退课
        s1.dropCourse(c2);    // 张三退大学物理

        // 7. 展示学生选课情况
        s1.showSelectedCourses();
        s2.showSelectedCourses();
    }
}